<extend name="Layout:layout_content" />
<block name="body_main">
    <taglib name="Common\TagLib\Sohtml"/>
    <Product:item pk="$Think.Get.id">
        <form action="{:AddonU('product_edit_save')}" method="post" class="xsui-form" enctype="multipart/form-data" style="min-width:800px;">
            <fieldset>
                <div class="xsui-form-field">
                    <label>标题：</label>
                    <input type="text" name="title" placeholder="标题" value="{$data.title}" title="{$data.title}" size="80" required="required" />
                </div>
                <div class="xsui-form-field">
                    <label>类别：</label>
                    <select name="category_id" data-url="{:AddonU('Channels/get_channel_tree_json','type_id=2')}" data-value="{$data.category_id}"></select>
                </div>
                <div class="xsui-form-field">
                    <label>作者：</label>
                    <input type="text" name="author" value="{$data.author}"  placeholder="作者" />
                </div>
                <div class="xsui-form-field">
                    <label>来源：</label>
                    <input type="text" name="source" value="{$data.source}" placeholder="来源" size="80" />
                </div>
                <div class="xsui-form-field">
                    <label>图片：</label>
                    <sohtml:file name="picture_url" value="{$data.picture_url}" />
                </div>
                <div class="xsui-form-field-vertical">
                    <label>摘要内容：</label>
                    <textarea name="summary" placeholder="摘要内容" required="required" cols="90" rows="3" style="width:99%">{$data.summary}</textarea>
                </div>
                <div class="xsui-form-field-vertical">
                    <label>正文内容：</label>
                    <textarea name="content" class="editor" cols="90" rows="6" style="width:99%">{$data.content}</textarea>
                </div>
                <div class="xsui-form-field">
                    <label>发布时间：</label>
                    <input type="text" name="create_time" value="{$data.create_time}" placeholder="发布时间" class="datetimepicker" />
                </div>
                <div class="xsui-form-field xsui-form-mgb">
                    <label>状态：</label>
                    <sohtml:radio name="status" items="1=显示;0=隐藏" value="{$data.status}" required="required" />
                </div>
            </fieldset>
            <button type="submit">保存</button>
            <input type="hidden" name="id" value="{$data.id}"/>
    </Product:item>
</form>
</block>
<block name="body_after">
    <script>
        $(function () {
            ajax_combobox({selector: 'select[name="category_id"]', def_option: '请选择类别'});
        })
    </script>
</block>